top of page
게시판 게시물
sararyu07
2024년 2월 28일
In 소스 코드 제출
# def solution(num):
# num = list(map(str,num))
# print(num)
# s = []
# for i in range(len(num)):
# s.append(num[i] * 2)
# print(s)
# # num.sort(reverse=True)
# num.sort(key=lambda x: x*12345, reverse=True)
# return str(int(''.join(num)))
#
# a = [3, 30, 34, 5, 9]
#
# # a = [11100, 10110, 10111, 10001, 110100]
# print(solution(a))
# def solution(arr):
# ans = []
# ans.append(arr[0])
# for i in range(1,len(arr)):
# if ans[-1] != arr[i]:
# ans.append(arr[i])
# return ans
#
# a = [1,1,3,3,0,1,1]
# print(solution(a))
# pp = []
# cnt = 0
# def search(x,c):
# global pp
# global cnt
# if x+1<len(pp) and pp[x+1] >=100:
# pp[x+1] = -1
# search(x+1,c+1)
# else:
# cnt = c
# return
# def solution(pro, spe):
# global pp
# global cnt
# ans = []
# ll = len(pro)
# pp = pro
# while pro[-1] != -1:
# for i in range(ll):
# if pp[i] != -1:
# pp[i] += spe[i]
#
#
# for i in range(ll):
# cnt = 0
# if pp[i] >= 100 and (i==0 or pp[i-1]==-1):
# pp[i] = -1
# search(i,1)
# ans.append(cnt)
# print(pp)
# return ans
#
# a = [95, 90, 99, 99, 80, 99]
# b = [1, 1, 1, 1, 1, 1]
# print(solution(a,b))
# def solution(s):
# answer = True
# cnt = 0
# ll = len(s)
# for i in range(ll):
# if s[i] == '(':
# cnt += 1
# elif s[i] == ')':
# cnt -= 1
# if cnt < 0:
# answer = False
# break
# if cnt != 0:
# answer = False
# return answer
#
# a = ")()("
# print(solution(a))
# def solution(pri, loc):
# answer = 0
# key = []
# ll = len(pri)
# for i in range(ll):
# u = [i, pri[i]]
# key.append(u)
# ma = 0
# for i in range(ll):
# if ma < pri[i]:
# ma = pri[i]
# cnt = 0
# while len(key) != 0:
# #print('max', ma)
# #print('v', ll, key)
# flag = 0
# for i in range(ll):
# if ma == key[i][1]:
# flag = 1
# break
# if flag == 1:
# if key[0][1] == ma:
# cnt += 1
# ll -= 1
# c = key.pop(0)
# if c[0] == loc:
# answer = cnt
# #print(cnt)
# #print(key, ma)
# else:
# temp = key.pop(0)
# key.append(temp)
# flag = 0
# for i in range(ll):
# if key[i][1] == ma:
# flag = 1
# break
# if flag == 0:
# # print('v')
# ma -= 1
# else:
# ma -= 1
# return answer
#
# a = [2, 1, 3, 2]
# b = 2
# print(solution(a,b))
# def solution(b_l, wei, t_w):
# cnt = 0
# bri = [0]*b_l
# arr = []
# while len(t_w) > 0:
# cnt += 1
# arr.append(bri[-1])
# for i in range(b_l):
# temp = bri[i]
# bri[i] = bri[i+1]
# bri[i+1] = temp
# if sum(bri) + t_w[0] > wei:
# bri[0] = 0
# else:
# bri[0] = t_w[0]
# return cnt
#
# a = 2
# b = 10
# c = [7,4,5,6]
# print(solution(a,b,c))
# def solution(pri):
# answer = []
# for i in range(len(pri)):
# key = pri[i]
# cnt = 0
# for j in range(i, len(pri)):
# if pri[j] < key:
# cnt += 0
# else :
# cnt += 1
# answer.append(cnt-1)
#
# return answer
#
# a = [5, 6, 4, 3, 2, 1]
# print(solution(a))
0
0
1
sararyu07
2024년 2월 27일
In 소스 코드 제출
# maxi = 0
# np = []
# ll = 0
# def search(g):
# global maxi
# k = int(g)
# if k > maxi:
# maxi = k
#
# def find(n, l, r):
# global np
# global ll
# if l == 1:
# search(n)
# return
# for i in range(ll):
# c = 1<<i
# if r & c == False:
# y = []
# y.append(n)
# y.append(np[i])
# find(''.join(y), l-1, r+c)
# def solution(numbers):
# global maxi
# global np
# global ll
# answer = ''
# np = list(map(str, numbers))
# ll = len(numbers)
# p = ''.join(map(str, numbers))
# search(p)
# #print(p)
# for i in range(ll):
# c = 1<<i
# find(str(numbers[i]), ll, c)
# answer = str(maxi)
# return answer
#
# a = [6, 10, 2]
# print(solution(a))
# bubbl
# def search(c, h):
# cnt = 0
# for i in range(len(c)):
# if c[i] >= h:
# cnt += 1
# if cnt >= h:
# return True
# return False
#
# def solution(cit):
# answer = 0
# ll = len(cit)
# for i in range(1,ll+1):
# if search(cit, i) == True:
# answer = i
#
# return answer
#
# a = [3, 0, 6, 1, 5]
# print(solution(a))
def solution(num):
answer = ''
np = list(map(str, num))
ll = len(num)
ans = []
np.sort(reverse=True)
for i in range(ll):
if np[i][0] > np[i+1][0]:
ans.append(np[i][0])
return answer
a = [3, 30, 34, 5, 9]
print(solution(a))
### 3 30이 있으면 3을 33으로 취급?
0
0
1
sararyu07
2024년 2월 21일
In 소스 코드 제출
# arr = []
# cnt = 10000
# check = []
#
# def search(a, n):
# global arr
# global check
# # print('>>>', a, n)
# for i in range(n):
# #print('vv', a, i)
# if arr[a][i] == 1 and check[i] != 1:
# check[i] = 1
# arr[a][i] = arr[i][a] = 0
# search(i,n)
# arr[a][i] = arr[i][a] = 1
# return
#
# def solution(n, wires):
# answer = -1
# global arr
# global check
# global cnt
# check = [0] * n
# for i in range(n):
# c = [0]*n
# arr.append(c)
#
# for i in range(len(wires)):
# arr[wires[i][0]-1][wires[i][1]-1] = arr[wires[i][1]-1][wires[i][0]-1] = 1
# #print(arr)
# for i in range(n):
# for j in range(n):
# #print(i, j)
# if arr[i][j] == 1:
# #print('x')
# arr[i][j] = arr[j][i] = 0
# check[0] = 1
# search(0, n)
# arr[i][j] = arr[j][i] = 1
# #print(check)
# u = sum(check)
# if u > n // 2:
# if cnt > u - (n - u):
# cnt = u - (n - u)
# else:
# if cnt > (n - u) - u:
# cnt = (n - u) - u
# check = [0] * n
#
# answer = cnt
# return answer
#
# z = 9
# h = [[1,3],[2,3],[3,4],[4,5],[4,6],[4,7],[7,8],[7,9]]
# print(solution(z, h))
# import math
# ppp = []
# check = []
# cnt = 0
# ll = 0
# ans = []
# def prime(a):
# flag = 0
# if a == 0 or a == 1:
# return False
# for i in range(2, int(math.sqrt(a))+1):
# if a%i == 0:
# flag = 1
# break
# if flag == 1:
# return False
# return True
#
# def num(n,lp, le):
# #print('v', n, le)
# global cnt
# global ll
# global ppp
# if le == 1 :
# if prime(n):
# #print('rr', n)
# for i in range(len(ppp)):
# if ppp[i] == n:
# return
# ppp.append(n)
# cnt += 1
# else:
# for i in range(ll):
# if check[i] != 1:
# check[i] = 1
# #print('len 222', lp-le+1)
# num(n+ (ans[i] (10*(lp-le+1))),lp, le-1)
# check[i] = 0
#
# def solution(numbers):
# global cnt
# global ll
# global check
# answer = 0
# global ans
# ll = len(numbers)
# for i in range(ll):
# ans.append(int(numbers[i]))
# #print(ans)
# check = [0] * (ll+1)
# for i in range(1, ll+1):
# for j in range(ll):
# check[j] = 1
# num(int(numbers[j]), i, i)
# check[j] = 0
# answer = cnt
# return answer
#
# a = "123"
# print(solution(a))
# def solution(array, commands):
# answer = []
# ll = len(commands)
# for i in range(ll):
# sample = []
# for j in range(commands[i][0]-1, commands[i][1]):
# sample.append(array[j])
# sample.sort()
# answer.append(sample[commands[i][2]-1])
# return answer
#
# v = [1, 5, 2, 6, 3, 7, 4]
# c = [[2, 5, 3], [4, 4, 1], [1, 7, 3]]
# print(solution(v,c))
0
0
1
sararyu07
2024년 2월 13일
In 소스 코드 제출
#########################
# cnt =0
# ll = 0
# def num(n, k):
# global cnt
# global ll
# flag = 0
# for i in range(n/2):
# if n%i == 0 or n == 1:
# flag = 1
# break
# if flag == 0 :
# cnt +=1
# for i in range():
# num(, k-1)
# def solution(numbers):
# global cnt
# global ll
# answer = 0
# ll = len(numbers)
# for i in range(ll):
# num(numbers[i], ll)
#
# return answer
#
# v = "17"
# print(solution(v))
# max = -10000000
# n, k = map(int, input().split())
# v = list(map(int, input().split()))
# if n == k:
# print(sum(v))
# exit()
# for i in range(n-k+1):
# if sum(v[i:i+k]) > max:
# max = sum(v[i:i+k])
# print(max)
sum = 0
def gcd(x,y):
for i in range(y-1, 0, -1):
if x%i==0 and y%i ==0:
return i
a, b = map(int, input().split())
for i in range(a,b+1):
num = [1]*i
for j in range(i+1, b):
u = gcd(i,j)
for k in range(i):
if k%u == 0:
num[k] = 0
sum += sum(num)
print(sum)
0
0
2
sararyu07
2024년 2월 06일
In 소스 코드 제출
def solution(sizes):
answer = 0
c = []
flag = 0
for i in range(len(sizes)):
for j in range(2):
c.append(sizes[i][j])
lll = len(c)-1
c.sort()
for i in range(len(sizes)):
if
for j in range(2):
if sizes[i][0] == c[lll]:
if sizes[i][1] == c[lll // 2]:
flag = 1
if sizes[i][1] > c[lll // 2]:
flag = sizes[i][1]
if flag==1:
answer = c[lll]*c[lll//2+1]
elif flag > 1:
answer = flag*c[lll]
else:
answer = c[lll] * c[lll//2]
return answer
l = [[30,30], [60,60], [40,40], [60,50]]
print(solution(l))
###############
# arr = []
# def search(a,b):
# if arr[a+dx[dir]][b+dy[dir]] == arr[a][b]:
# cnt+=1
#
# for i in range(19):
# v = list(map(int, input().split()))
# arr.append(v)
#
# for i in range(19):
# for j in range(19):
# if arr[i][j] != 0:
# search(i,j)
# arr = []
# cnt = 0
# dx = [1 ,0 ,1, -1]
# dy = [0, 1, 1, 1]
# def search(x,y,num,dir):
# global arr
# global cnt
# cnt += 1
# if x+dx[dir]>-1 and x+dx[dir]<19 and y+dy[dir]<19 and arr[x+dx[dir]][y+dy[dir]] == num:
# search(x+dx[dir], y+dy[dir], num, dir)
# for i in range(19):
# v = list(map(int,input().split()))
# arr.append(v)for i in range(19):
# for j in range(19):
# if arr[i][j]!=0:
# cnt = 0
# for k in range(4):
# if i-dx[k]>-1 and j-dy[k] and i+dx[k]<19 and j+dy[k]<19 and arr[i][j]!=arr[i-dx[k]][j-dy[k]] and arr[i][j] == arr[i+dx[k]][j+dy[k]]:
# search(i,j,arr[i][j],k)
# if cnt == 5:
# print(arr[i][j])
# print(i+1,j+1)
# exit()
# cnt = 0
# print(0)
0
0
2
sararyu07
2024년 1월 31일
In 소스 코드 제출
arr = []v = []ans = [0,0,0]min = 2000def search(a, b): global v global min global ans c = sum(v) - a -b if a >= b and b >= c and a-c<min: ans[0] = a ans[1] = b ans[2] = c min = a-cn = int(input())v = list(map(int, input().split()))for i in range(2): u=[] for j in range(701): c = [0]*701 u.append(c) arr.append(u)arr[0][0][0] = 1for i in range(n): for j in range(701): for k in range(701): if (j-v[i]>-1 and k-v[i]>-1) and (arr[i%2][j][k]==1 or arr[i%2][j-v[i]][k]==1 or arr[i%2][j][k-v[i]]==1): arr[(i+1)%2][j][k] = 1for i in range(701): for j in range(701): if arr[n%2][i][j] == 1 : search(i,j)print(ans[0],ans[1],ans[2])
# arr = []# n = int(input())# for i in range(n):# c = [0]*n# arr.append(c)# arr[0][0] =1# for i in range(1,n):# for j in range(i+1):# if j-1<0:# arr[i][j]=arr[i-1][j]# else:# arr[i][j] = arr[i - 1][j] + arr[i - 1][j - 1]## for i in range(n):# for j in range(i+1):# print(arr[i][j],end=' ')# print()# mon = []# min = 10000# ans = 0# def search(m, cnt):# global ans# global mon# global min# if cnt>ans:# return# if m == 0:# if cnt<min:# min = cnt# for i in range(len(mon)-1, -1, -1):# if m-mon[i]>0:# print(m-mon[i], cnt+1)# search(m - mon[i], cnt + 1)### def greedy(a):# global ans# m = a# for i in range(len(mon)):# if(m//mon[i]>0):# ans += m//mon[i]# m %= mon[i]## w = int(input())# n = int(input())# mon = list(map(int, input().split()))# greedy(w)# search(w, 0)# print(min)# import threading## a, b = map(int, input().split())## def summ():# global a# global b# print('%.1f' %((a*b)/2))## th1 = threading.Thread(target = summ)# th1.start()def solution(sizes): answer = 0 c = [] flag = 0 for i in range(len(sizes)): for j in range(2): c.append(sizes[i][j]) c.sort() for i in range(len(sizes)): if sizes[i][0]==c[len(c)-1]: if sizes[i][1]==c[(len(c)-1)//2]: flag=1 if sizes[i][0]==c[(len(c)-1)//2]: if sizes[i][0]==c[len(c)-1]: flag=1 if flag==1: answer = c[len(c)-1]*c[(len(c)-1)//2+1] else: answer = c[len(c)-1] * c[(len(c)-1)//2] return answer# v = list(input())v = [[60, 50], [30, 70], [60, 30], [80, 40]]print(solution(v))
0
0
2
sararyu07
2024년 1월 30일
In 소스 코드 제출
arr = []dx = [0,1]dy = [1,0]def search(l, d, x, y): global arr global dx global dy n = x m = y # print(n,m) for i in range(l): # print('v', 'n', n, 'm', m, end= ' ') arr[n-1][m-1] = 1 n += dx[d] m += dy[d]a, b = map(int, input().split())o = int(input())for i in range(a): v = [0]*b arr.append(v)for i in range(o): p, q, r, s = map(int,input().split()) search(p,q,r,s)for i in range(a): for j in range(b): print(arr[i][j], end = ' ') print()import syslimit_number = 21000sys.setrecursionlimit(limit_number)arr = []ans = []arr2 = []dx = [1,0,-1,0]dy = [0,1,0,-1]f = 0def count(p,q): arr2[p][q] = 0 for i in range(4): if p+dx[i]>=0 and p+dx[i]<n and q+dy[i]>=0 and q+dy[i]<n and arr2[p+dx[i]][q+dy[i]]: count(p+dx[i], q+dy[i])def search(high): global arr for i in range(n): for j in range(n): if arr[i][j] > high: arr2[i][j] = 1 for i in range(n): for j in range(n): if arr2[i][j] == 1: ans[high] += 1 count(i, j)n = int(input())for i in range(n): c = [0]*n arr2.append(c) v = list(map(int, input().split())) arr.append(v)for i in range(n): for j in range(n): if f<arr[i][j]: f = arr[i][j]ans = [0]*(f+1)for i in range(f): search(i)print(max(ans))
# v = []# n = 0# x = 0# y = 0# z = 0# min = 2000# def search(a,b,c,m):# global n# global x# global y# global z# global min# if m == n:# if a>=b and b>=c and a-c<min:# x=a# y=b# z=c# min = a-c# return# search(a+v[m], b, c, m+1)# search(a, b+v[m], c, m+1)# search(a, b, c+v[m], m+1)## n = int(input())# v = list(map(int, input().split()))# search(0,0,0,0)## print(x,y,z)# # a >= b >= carr = []cnt = 0dx = [1 ,0 ,1, -1]dy = [0, 1, 1, 1]def search(x,y,num,dir): global arr global cnt cnt += 1 if x+dx[dir]>-1 and x+dx[dir]<19 and y+dy[dir]<19 and arr[x+dx[dir]][y+dy[dir]] == num: search(x+dx[dir], y+dy[dir], num, dir)for i in range(19): v = list(map(int,input().split())) arr.append(v)for i in range(19): for j in range(19): if arr[i][j]!=0: cnt = 0 for k in range(4): if i-dx[k]>-1 and j-dy[k] and i+dx[k]<19 and j+dy[k]<19 and arr[i][j]!=arr[i-dx[k]][j-dy[k]] and arr[i][j] == arr[i+dx[k]][j+dy[k]]: search(i,j,arr[i][j],k) if cnt == 5: print(arr[i][j]) print(i+1,j+1) exit() cnt = 0print(0)
0
0
2
sararyu07
2024년 1월 03일
In 소스 코드 제출
#include <stdio.h>
int n;
int money[1009], arr[1009][1009];
void sum(int k){
int dice[7]={0}, cnt=0;
for(int i=0; i<n; i++){
dice[arr[k][i]]++;
}
for(int i=1 ;i<=6;i++){
if(dice[i]==4){
money[k]=50000+i*5000;
return;
}
else if(dice[i]==3){
money[k]=10000+i*1000;
return;
}
//
else if(dice[i]==2){
if(!cnt){
cnt=i;
}
else{
money[k]=2000+i*500+cnt*500;
return;
}
}
//
}
if(cnt){
money[k]=1000+cnt*100;
}
// printf("num:%d mon: %d\n", k, money[k]);
int max=0;
for(int i=0;i<n; i++){
if(max<arr[k][i])
max=arr[k][i];
}
money[k]=max*100;
}
int main(){
int max=0;
scanf("%d", &n);
for(int i=0; i<n; i++){
for(int j=0; j<4; j++){
scanf("%d", &arr[i][j]);
}
}
for(int i=0; i<n; i++){
sum(i);
}
for(int i=0; i<n; i++){
// printf("%d\n", money[i]);
if(max<money[i]){
max=money[i];
}
}
printf("%d", max);
}
#include <stdio.h>
#include <stack>
std::stack<int> st;
int main(){
scanf("%d", &n);
for(int i=0;i<n;i++){
int a;
scanf("%d", &a);
stack.push(a);
}
}
0
0
1
sararyu07
2023년 8월 03일
In 소스 코드 제출
//#include <stdio.h>
//int sum, a[100][2];
//int map[100][100];
//int i, j, p;
//void com(int x, int y){
// map[y][x]=0;
// map[x][y]=0;
// sum++;
// for(i=x; i<p; i++){
// if(map[y][i]==1) com(y,)
// }
//}
//#include<stdio.h>
//int map[105][105] = {0};
//int visit[105] = {0};
//
//int i, j, x, y, n, k;
//
//void findItem(int q, int f) {
// if(q > f) {
// return;
// }
// for(int xi=1; xi<=n; xi++) {
// if(map[q][xi] == 1) {
// visit[xi] = 1;
// map[q][xi] = 0;
// map[xi][q] = 0;
// findItem(xi, f);
// }
// }
//}
//
//int main()
//{
// scanf("%d", &n);
// scanf("%d", &k);
//
// for(i=0; i<k; i++)
// {
// scanf("%d %d", &x, &y);
// map[x][y] = 1;
// map[y][x] = 1;
// }
//
// for(i=1; i<=n; i++)
// {
// for(j=1; j<=n; j++)
// {
// printf("%d ", map[i][j]);
// }
// printf("\n");
// }
//
// findItem(1, n);
//
// int s = 0;
// for(i=1; i<=n; i++) {
// s += visit[i];
// }
// printf("%d", s);
//
//}
#include <stdio.h>
int high[505][505]={0};
int map[505][505]={0};
int i, j, n, k, sum;
void find(int f, int q){
int e;
for(e=1; e<=n; e++){
if(map[q][e]==1){
high[f][e]=1;
find(f, e);
}
}
}
int main(){
int x, y, cnt;
scanf("%d", &n);
scanf("%d", &k);
for(i=0; i<k; i++){
scanf("%d %d", &x, &y);
map[x][y]=1;
}
for(i=1; i<=n; i++){ //여기 3중 반복문 없애기
find(i, i);
}
// for(i=1; i<=n; i++){
// for(j=1; j<=n; j++){
// printf("%d ", high[i][j]);
// }
// printf("\n");
// }
for(i=1; i<=n; i++){
for(j=1; j<=n; j++){
cnt+=high[i][j]+high[j][i];
}
if(cnt==n-1){
sum++;
}
cnt=0;
}
printf("%d", sum);
}
0
0
2
sararyu07
2023년 8월 01일
In 소스 코드 제출
//#include <stdio.h>
//int d[4][2]={{1,0},{-1,0},{0,1},{0,-1}};
//int map[9][9]={0};
//int num;
//void pop(int x, int y){
// int p,i;
// p=map[x][y];
// map[x][y]=0;
// for(i=0; i<4; i++){
// if(map[x+d[i][0]][y+d[i][1]]==p){
// num++;
// pop(x+d[i][0], y+d[i][1]);
// }
// }
//}
//int main(){
// int i, j, a=1, b=1, sum=0;
// for(i=1; i<=7; i++){
// for(j=1; j<=7; j++){
// scanf("%d", &map[i][j]);
// }
// }
// while(a<8){
// if(map[a][b]!=0){
// pop(a, b);
// if(num>1) sum++;
// num=0;
// }
//// for(i=1; i<=7; i++){
//// for(j=1; j<=7; j++){
//// printf("%d ", map[i][j]);
//// }
//// printf("\n");
//// }
//// printf("sum: %d", sum);
//// printf("\n");
// if(b==7){
// b=1;
// a++;
// }
// else b++;
// }
// printf("%d", sum);
//}
#include <stdio.h>
int sum, a[100][2]= {0};
int map[100][100]= {0};
int i, j, p;
void com(int x, int y)
{
map[y][x]=0;
map[x][y]=0;
sum++;
for(i=x; i<p; i++)
{
if(map[y][i]==1) com(y,i);
}
}
int main()
{
int n;
scanf("%d", &n);
scanf("%d", &p);
for(i=0; i<p; i++)
{
scanf("%d %d", &a[i][0], &a[i][1]);
map[a[i][0]][a[i][1]]=1;
map[a[i][1]][a[i][0]]=1;
}
com(a[0][0], a[0][1]);
printf("%d", sum);
}
0
0
2
sararyu07
2023년 7월 27일
In 소스 코드 제출
#include <stdio.h>
int d[4][2]={{1,0}, {-1,0}, {0,1}, {0,-1}};
int map[8][8]={-1};
int num;
void pop(int x, int y){
int p, i;
p=map[x][y];
map[x][y]=0;
for(i=0; i<4; i++){
if(map[x+d[i][0]][y+d[i][1]]==p){
num++;
pop(x+d[i][0], y+d[i][1]);
}
}
}
int main(){
int i, j, a, b, sum=0;
for(i=1; i<=7; i++){
for(j=1; j<=7; j++){
scanf("%d", &map[i][j]);
}
}
a=1;
b=1;
while (a<8){
if(map[a][b]!=0){
pop(a,b);
if(num>=2) sum++;
num=0;
}
if(b==7){
b=1; a++;
}
else b++;
// for(i=1; i<=7; i++){
// for(j=1; j<=7; j++){
// printf("%d ", map[i][j]);
// }
// printf("\n");
// }
}
printf("%d", sum);
}
0
0
2
sararyu07
2023년 7월 25일
In 소스 코드 제출
//#include <stdio.h>
//int main()
//{
// int x, y, i, j, a=0, front, rear, flag, lap=0,g=0;
// int map[1005][1005]= {0}, q[2][1000005]= {0};
// int dir[4][2]= {{1,0},{-1,0},{0,1},{0,-1}};
// scanf("%d %d", &x, &y);
//
// for(i=0; i<=y+1; i++) {
// for(j=0; j<=x+1; j++) {
// map[i][j] = -1;
// }
// }
//
// for(i=1; i<=y; i++)
// {
// for(j=1; j<=x; j++)
// {
// scanf("%d", &map[i][j]);
// if(map[i][j]==1)
// {
// q[0][a]=i;
// q[1][a]=j;
// a++;
// }
// }
// }
// if(a==x*y){
// printf("0");
// return;
// }
// front=0;
// rear=a;
// flag=rear;
// while(front!=rear)
// {
// for(i=0; i<4; i++)
// {
// if(map[q[0][front]+dir[i][0]][q[1][front]+dir[i][1]]==0)
// {
// q[0][rear]=q[0][front]+dir[i][0];
// q[1][rear]=q[1][front]+dir[i][1];
// map[q[0][rear]][q[1][rear]]=1;
// rear++;
// }
// }
//
// front++;
// if(front==flag)
// {
// lap++;
// flag=rear;
// }
//
//// for(i=1; i<=y; i++) {
//// for(j=1; j<=x; j++) {
//// printf("%d ", map[i][j]);
//// }
//// printf("\n");
//// }
//// printf("\n");
//// scanf("%d", &g);
// }
//// for(i=0; i<rear; i++){
//// printf("%d %d\n", q[0][i], q[1][i]);
//// }
// for(i=1; i<=y;i++){
// for(j=1; j<=x;j++){
// if(map[i][j]==0){
// g=1;
// break;
// }
// }
// }
// if(g==1) printf("-1");
// else
// printf("%d", lap-1);
//
//}
#include <stdio.h>
int main(){
int k=0; a=0;
int q[13][32]={0};
scanf("%d", &n);
for(i=0; i<n; i++){
scanf("%d %d %d %d", &q1[0][i], &q1[1][i], &q2[0][i], &q2[1][i]);
}
flag1=3;
flag2=1;
while(1){
for(i=0; i<n; i++){
if(q1[0][i]<flag1){
if(q2[0][i]>k){
cnt=i;
k=q2[0][i];
}
}
}
flag1=k;
flag2=q2[1][cnt];
}
}
// while(1){
// for(i=0; i<n; i++){
// if(f[0]>m1[i]){
// f[0]=m1[i];
// cnt=0;
// }
// else if(k==m1[i]){
// cnt++;
// f[cnt]=i;
// }
// }
// for(i=0; i<cnt; i++){
//
// }
// lap++;
// }
0
0
1
sararyu07
2023년 7월 21일
In 소스 코드 제출
//#include <stdio.h>
//int main(){
// int n, i;
// long long int top=0,sum=0;
// int cow[80000]={0}, stack[80000]={0};
// scanf("%d", &n);
// for(i=0; i<n; i++){
// scanf("%d", &cow[i]);
// }
// i=0;
// while(i<n){
//// printf("%d\n", top);
// stack[top]=cow[i];
//// printf("%d %d\n", top, stack[top]);
// while(top!=0&&stack[top-1]<=stack[top]){
// stack[top-1]=stack[top];
//
// top--;
//// printf("%d\n", top);
// sum=sum+top;
// }
// top++;
// i++;
// }
// sum=sum+(top-1)*top/2;
// printf("%lld", sum);
//}
//#include <stdio.h>
//int main(){
// int cnt=0, i,j,z,p=0, a=0, lap=0;
// int map[100][100]={0};
// scanf("%d %d", &x, &y);
// for(i=0; i<y; i++){
// for(j=0; j<x; j++){
// scanf("%d", &map[y][x]);
// }
// }
// while(1){
// if(map[i][j]==1){
// if(map[i+1][j]==0) map[i+1][j]=1; a++;
// if(map[i][j-1]==0) map[i][j-1]=1; a++;
// if(map[i-1][j]==0) map[i-1][j]=1; a++;
// if(map[i][j+1]==0) map[i][j+1]=1; a++;
// }
// lap++;
// if(lap==x*y){
// cnt++; lap=0;
// if(p==a) break;
// p=a;
// }
// }
// for(i=0; i<y; i++){
// for(j=0; j<x; j++){
// if(map[i][j]==0){
// z++;
// break;
// }
//
// }
// }
// if(z==1) printf("-1");
// else printf("%d", lap);
//}
#include <stdio.h>
int main(){
int map[100][100]={0};
int cr[2][100]={0};
int i, j, a=0, flag, front=0, rear, cnt=0,n,m;
int di[4][2]={{-1,0}, {1,0}, {0,-1}, {0,1}};
scanf("%d %d", &n, &m);
for(i=0; i<m; i++){
for(j=0; j<n; j++){
scanf("%d", &map[i][j]);
if(map[i][j]==1){
cr[1][a]=j;
cr[2][a]=i;
a++;
}
}
}
flag=a;
rear=a;
while(front!=rear){
for(i=0; i<4; i++){
if(map[cr[2][front]+di[i][1]][cr[1][front]+di[i][0]]==0){
cr[1][rear]=cr[1][front]+di[i][0];
cr[2][rear]=cr[2][front]+di[i][1];
map[cr[2][rear]][cr[1][rear]]=1;
rear++;
}
}
front++;
if(front==flag) cnt++;
flag=rear;
}
// for(i=0; i<rear; i++){
// printf("%d %d\n", cr[1][i], cr[2][i]);
// }
// printf("%d %d\n", rear, a);
//rear==2412??
printf("%d", cnt);
}
// if(map[i][j]==0){
// cr[1][rear]=cr[1][front];
// cr[2][rear]=cr[2][front]+1;
// rear++;
0
0
2
sararyu07
2022년 12월 20일
In 소스 코드 제출
// strlen: length // strcmp: compare // strcpy: copy -> strcpy(v1, v2) // strstr: invite -> strstr(v1, v2) //#include <stdio.h> // //int main() { // char word[100]={0}; // //// printf("%d %d\n", &word[0], word); // //// scanf("%s", word); // // gets(word); // space // printf("%d\n", strlen(word)); // for(int i=0; i<100; i++) { // if(word[i]==0) { // printf("length is %d\n", i); // break; // } //// printf("%c:%d\n", word[i], word[i]); // } // //} //int main() { // char word[100] = {0}; // // scanf("%s", word); // printf("strcmp: %d\n", strcmp(word, "love")); // //} //#include<stdio.h> // //int main(){ // char word[100] = {0}; // // scanf("%s", word); //// same:0 / different:-1 / include:1 // // printf("strstr: %d\n", strstr(word, "life")); // same:64 // // printf("strlen: %d\n", strlen(word)); // // printf("strcpy: %s\n", strcpy(word, "life")); //} //#include <stdio.h> //int main() //{ // int i, j, t=0; // char word[100] = {0}; // char dummy[100] = {"word"}; // // scanf("%s", word); // printf("strstr: %d\n", strstr(word, "word")); // // word is good // // word // for(i=0; i<strlen(word); i++) // { // if(word[i] == dummy[0]) // { // t=0; // for(j=0; j<4; j++) // { //// printf("%c %c\n", word[i+j], dummy[j]); // if(word[i+j] != dummy[j]) // { // break; // } // else // { // t++; // } // } //// printf("%d\n", t); // if(t==4) // { // printf("%d", &word[i]); // break; // } // // } // } // if(t!= 4) // { // printf("0"); // } //} ////strcpy // //#include <stdio.h> // //int main(){ // int i; // char word[100] = {0}; // char dummy[100] = {"word"}; // // scanf("%s", word); //// printf("copy is %c",strcpy(word,"word") ); // // for(i=0; i<strlen("word"); i++){ // word[i] = dummy[i]; // printf("%c", word[i]); // } //} ////1419 //#include <stdio.h> //int main() //{ // int i, j, t=0, h=0; // char word[100] = {0}; // char dummy[100] = {"love"}; // gets(word); // //strstr // if(strstr(word, "love") != 0) // { // for(i=0; i<strlen(word); i++) // { // h=0; // if(word[i] == dummy[0]) // { // for(j=0; j<4; j++){ // if(word[i+j] != dummy[j]){ // h = 0; // break; // } // else{ // h++; // if(h == 4){ // t++; // } // } // // } // } // } // printf("%d", t); // } // else{ // printf("0"); // } //} //#include <stdio.h> //int main() { // char word[100] = {0}; // gets(word); // printf("%s", word); //} //#include <stdio.h> // //int main() { // int i; // char word1[100] = {0}; // char word2[100] = {0}; // // scanf("%s %s", word1, word2); // //// printf("%d %d \n", word1, word2); // // if(strlen(word1) < strlen(word2)) { // printf("%s %s", word1, word2); // } // else if(strlen(word1) > strlen(word2)) { // printf("%s %s", word2, word1); // } // else { // for(i=0; i<strlen(word1); i++){ // // if(word1[i] < word2[i]){ // printf("%s %s\n", word1, word2); // break; // } // else if (word1[i] > word2[i]){ // printf("%s %s\n", word2, word1); // break; // } // } // } // //} ////struct 설명 //#include<stdio.h> // //struct _student { // int kor, math, eng; // double height, weight; // char name[100]; //}; // // //struct _humanInfo { // char name[100]; //}; // //struct _student { // struct _humanInfo hi; // //}; // // // //int main() { // struct _student v; // struct _student p; // struct _student temp; // // struct _student *pv = v; // // pv->kor = 100; // // v.kor = 100; // v.eng = 200; // v.math = 300; // // p.kor = 10; // p.eng = 20; // p.math = 30; // // temp = v; // v = p; // p = temp; // // //// struct _student p[100]; //// //// for(int i=0; i<50; i++) { //// scanf("%s %lf %lf %d %d %d", p[i].name, &p[i].height, ...); //// } //// v.height = 180; //// v.weight = 70; //} #include <stdio.h> struct _stu { int a; }; int main() { int n; struct _stu t[200]; scanf("%d", &n); for(i=0; i<n; i++){ scanf("%d", &t[i].a); } for(i=0; i<n; i++){ printf("%d %d", t[i].a, ) } }
0
0
1
sararyu07
2022년 12월 06일
In 소스 코드 제출
//#include <stdio.h> //int n, i, a[51] = {0}; //int j, t=0; // //void f(int n) { // // for(i=1; i<=n; i++){ // t=0; // for(j=1; j<n; j++){ // if(i== a[j]){ // t++; // } // } // if(t!=1){ // printf("%d", i); // } // } //} // //int main() //{ // scanf("%d", &n); // for(i=1; i<n; i++){ // scanf("%d", &a[i]); // } // f(n); // //} //#include <stdio.h> // //double a; // //int gbs(){ // for(i=0; i<b; i++){ // a = a * ((100 + w[i])/100) // } //} // //int main(){ // int a, b; // scanf("%d\n%d", &a, &b); // for(i=0; i<b; i++){ // scanf("%d", &w[i]); // } // f(); // //} // strlen: length // strcmp: compare // strcpy: copy -> strcpy(v1, v2) // strstr: invite -> strstr(v1, v2) //#include <stdio.h> //int main() { // char word[100]={0}; // //// printf("%d %d\n", &word[0], word); // //// scanf("%s", word); // gets(word); // space // printf("%d\n", strlen(word)); // // for(int i=0; i<100; i++) { // if(word[i]==0) { // printf("length is %d\n", i); // break; // } //// printf("%c:%d\n", word[i], word[i]); // } // //} //int main() { // char word[100] = {0}; // // scanf("%s", word); // printf("strcmp: %d\n", strcmp(word, "love")); // //} //#include<stdio.h> // //int main(){ // char word[100] = {0}; // // scanf("%s", word); // same:0 / different:-1 / include:1 // // printf("strstr: %d\n", strstr(word, "life")); // same:64 // // printf("strlen: %d\n", strlen(word)); // // printf("strcpy: %s\n", strcpy(word, "life")); //} //#include <stdio.h> // //int main(){ // char word[100] = {0}; // // scanf("%s", word); // printf("strcmp: %d\n", strcmp(word, "word")); // if(word == "word"){ // printf("0"); // } // else if( word > "word"){ // printf("1"); // // } // else { // printf("-1"); // } //} // strcmp //#include<stdio.h> // //int main() { // char word[1000] = {0}; // char dummy[1000] = {"love"}; // int x =0, i; // scanf("%s", word); // //printf("%d", strcmp(word, "love")); // // // same: 0 // // alphabet: a(97) > e(102): -1 // // a: h < e: 1 // // // lovh //// x:0 -1, 1, break; // // love // // for(i=0; i<strlen(word); i++) { // if(word[i] > dummy[i]) { // x = 1; // break; // } // else if(word[i] < dummy[i]) { // x = -1; // break; // } // } // printf("%d", x); // //} //#include <stdio.h> //int main() //{ // int i, j, t=0; // char word[100] = {0}; // char dummy[100] = {"word"}; // // scanf("%s", word); // printf("strstr: %d\n", strstr(word, "word")); // // word is good // // word // for(i=0; i<strlen(word); i++) // { // if(word[i] == dummy[0]) // { // t=0; // for(j=0; j<4; j++) // { // printf("%c %c\n", word[i+j], dummy[j]); // if(word[i+j] != dummy[j]) // { // break; // } // else // { // t++; // } // } // printf("%d\n", t); // if(t==4) // { // printf("%p", &word[i]); // break; // } // // } // } // if(t!= 4) // { // printf("0"); // } //} #include <stdio.h>
0
1
6
sararyu07
2022년 11월 29일
In 소스 코드 제출
//#include <stdio.h> // //void f(){ // printf("**"); //} // //int main() //{ // f(); // return 0; //} // //#include <stdio.h> // //char f() { // return 'A'; //} // //int main() //{ // printf("%c", f() ); // return 0; //} //#include <stdio.h> // //int f() { // return 1; //} // //int main() //{ // printf("%d", f() ); // return 0; //} //#include <stdio.h> // //long long int f() { // return-2147483649; //} // //int main() //{ // printf("%lld", f() ); // return 0; //} //#include <stdio.h> // //float f() { // return 3.14f; //} // //int main() //{ // printf("%f", f()); // return 0; //} //#include <stdio.h> // //double f() { // return 3.1415926535897; //} // //int main() //{ // printf("%.13lf", f()); // return 0; //} //#include <stdio.h> // //long long int n; // //int sqrt(long long int k) { // long long int i; // for(i=0; ; i++ ){ // if(i*i > k){ // break; // } // } // return (int )i-1; //} // // //int main() //{ // scanf("%lld", &n); // printf("%d\n", sqrt(n)); // return 0; //} ////123456 ////>654321 //// ////123456%10 > 6 ////123456/10 > 12345 //// ////s += x(6); ////s *= 10; ////s += x(5); //// ////loop //#include <stdio.h> // //long long int n; // //long long int f(long long int k){ // long long int x, sum =0; // // for(;;){ // x = k%10; // sum *= 10; // sum += x; // k = k/10; // if (k==0){ // return sum; // } // // } //} // //int main() //{ // scanf("%lld", &n); // printf("%lld\n", f(n)); //} //#include <stdio.h> // //int f(int k){ // int x, sum=0; // for(;;){ // x = k%10; // sum += x; // k = k/10; // if(k==0){ // return sum; // } // } //} // //int main(){ // int n; // scanf("%d", &n); // // for(;;){ // if(f(n)<10){ // break; // } // else { // n = f(n); // } // } // // printf("%d", f(n)); //} //#include <stdio.h> // //long long int n, m; // //long long int f(long long int s, long long int k){ // if(s<k){ // return k-s; // } // else { // return s-k; // } //} // //int main() //{ // scanf("%lld%lld", &n, &m); // printf("%lld\n", f(n, m)); //} //#include <stdio.h> // //int a, b; //int gcd(int p, int q) //{ // if(p==0) // return q; // return gcd(q%p, p); //} // ///* //24 36 // //36%24: 12, 24 //24%12: 0, 12 // //return gcd( return gcd ( return // // //*/ // //int gcd(int x, int y) //{ // int i; // for(i=a>b?a:b; i>0; i--) // { // if (x%i==0 && y%i == 0) // { // return i; // } // } //} // //int main() //{ // scanf("%d%d", &a, &b); // printf("%d\n", gcd(a, b)); //} // pointer //#include<stdio.h> // // // //int main() { // int x = 10; // int *px = &x; // 4byte // double *py; // capacity: 4byte // // int arr[100] = {10, 20, 30}; // int *pArr = arr; // // printf("%d\n", pArr); // printf("%d\n", &arr[0]); // // pArr++; // printf("%d\n", pArr); // printf("%d\n", *pArr); // // printf("%d\n", x); // printf("%p\n", &x); // // // // return 0; //} #include<stdio.h> void swap(int *a, int *b) { int t; t = *a; *a = *b; *b = t; } int main() { int x, y; scanf("%d %d", &x, &y); swap(&x, &y); // call by reference // v(x, y); // call by value printf("%d %d", x, y); }
0
0
2
sararyu07
2022년 11월 15일
In 소스 코드 제출
//#include <stdio.h> // //int main() { // int a, b, i, j, t=0, map[11][11] = {0}; // for(i=1;i<10;i++){ // for(j=1; j<10;j++){ // scanf("%d", &map[i][j]); // } // } // scanf("%d %d", &a, &b); // if(map[a][b] == 1){ // printf("-1"); // return 0; // } // else{ // for(i=a-1;i<a+2;i++){ // for(j=b-1;j<b+2;j++){ // if(map[i][j] == 1){ // t+=1; // } // } // } // } // printf("%d", t); //} //#include <stdio.h> //int main() //{ // int n, i, j, k, t[12][12]= {0}, a[9] = {0}, b[9] = {0}; // int map[12][12] = {0}; // for(i=0; i<12; i++) // { // for(j=0; j<12; j++) // { // if(i==0 || j==0 || i==11 || j==11) // { // map[i][j] = -1; // } // else // { // scanf("%d", &map[i][j]); // } // } // } // scanf("%d", &n); // for(i=0; i<n; i++) // { // scanf("%d %d", &a[i], &b[i]); // } // for(i=1; i<11; i++) // { // for(j=1; j<11; j++) // { // if(map[i][j] > 0) // { // t[i][j]=map[i][j]; // } // } // } // for(i=1; i<11; i++) // { // for (j=1; j<11; j++) // { // if(t[i][j]>0) // { // for(k=i; k>=i-t[i][j]; k--) // { // if(map[k][j] == -1) // { // break; // } // else // { // map[k][j] = -2; // } // } // for(k=i+1; k<=i+t[i][j]; k++) // { // if(map[k][j]==-1) // { // break; // } // else // { // map[k][j] = -2; // } // } // for(k=j; k>= j-t[i][j]; k--) // { // if(map[i][k] == -1) // { // break; // } // else // { // map[i][k] = -2; // } // } // for(k=j+1; k<=j+t[i][j]; k++) // { // if(map[i][k]==-1) // { // break; // } // else // { // map[i][k] = -2; // } // } // } // } // } // for(i=0; i<n; i++){ // if(map[a[i]][b[i]] != -2){ // map[a[i]][b[i]] = i+1; // } // } // for(i=1; i<11; i++) // { // for(j=1; j<11; j++) // { // printf("%d ", map[i][j]); // } // printf("\n"); // } // printf("Character Information \n"); // for(i=0; i<n; i++) // { // if(map[a[i]][b[i]] == -2) // { // printf("player %d dead\n", i+1); // } // else // { // printf("player %d survive\n", i+1); // } // } //} //for(i=0; i<map[i][j]; i++){ // for(j=0; j<map[i][j]; j++){ // map[i][j] = -2; // } //} // map[i][j] = t // i-t ~ i+t // j-t ~ j+t // map[a][b] = -2; //#include <stdio.h> //int main(){ // int m, n, x, y,i, j, k, h, t=0, p=0; // int map[101][101] = {0}; // // scanf("%d %d %d %d", &m, &n, &x, &y); // for(i=0; i<n; i++){ // for(j=0; j<m; j++){ // scanf("%d", &map[i][j]); // } // } // for(i=0; i<n-y+1; i++){ // for(j=0; j<m-x+1; j++){ // for(k=i; k<=i+y-1; k++){ // for(h=j; h<=j+x-1; h++){ // p += map[k][h]; // } // } // if(t < p){ // t=p; // // } // p=0; // } // } // printf("%d", t); // //} ////#include <stdio.h> //// ////int pppx; // global variable //// ////int sum(int x, int y) { //// //// int pp; // local variable //// printf("%d ", pppx); //// return x+y; ////} //// ////void par() { //// printf("Hello Welcome to the me\n"); //// return ; ////} //// ////void solid(int x, int y) { //// printf("summation %d\n", x + y); //// ////} //// ////// modulation ////int main(){ //// int x, y; //// pppx = 100000; //// //// scanf("%d %d", &x, &y); //// int p = sum(x, y); //// printf("%d", p); //// //// par(); //// ////} //#include <stdio.h> // //void f(){ // printf("hello"); //} // // //int main() //{ // f(); // return 0; //} //#include <stdio.h> // //void f() { // printf("%d", 123); // return; // //} // // //int main() { // f(); // return 0; // //} #include <stdio.h> void f(){ printf("%c", '*'); return ; } int main() { f(); return 0; }
0
0
2
sararyu07
2022년 11월 01일
In 소스 코드 제출
//#include <stdio.h> // // // //int main() { // // int n, x, y, i, j, k=1; // // int map[51][51] = {0}; // // scanf("%d", &n); // // x = 0; // y = (n+1)/2 -1; // map[x][y] = k++; // if(n!=1) { // for (i=0; i<n*n; i++){ // x--; // y++; // // if(x<0) x =n-1; // if(y>=n) y = 0; // // if(k%n == 0){ // map[x][y] = k; // x+=2; // y-=1; // } // // map[x][y] = k++; // // } // } // for(i=0; i<n; i++) { // for (j=0; j<n; j++){ // printf("%d ", map[i][j]); // } // printf("\n"); // } //} //#include <stdio.h> // // int main() { // int n, i, j, k=0, t=0; // int map[101][101] = {0}; // scanf("%d", &n); // for(i=0; i<n; i++){ // for(j=0; j<n; j++){ // map[i][j] = k++; // if(i==0 || j==0 || i==n-1 || j==n-1){ // t += k; // } // } // } // printf("%d", t); // } //#include <stdio.h> //int main() { // int n, x, y, i ,j; // int map[101][101] = {0}; // scanf("%d %d %d", &n, &x, &y); // for(i=1; i<=n; i++){ // for(j=1; j<=n; j++){ // if(i<x){ // map[i][j] += x-i; // } // else{ // map[i][j] += i-x; // } // if(j<y){ // map[i][j] += y-j+1; // } // else { // map[i][j] += j-y+1; // } // // printf("%d ", map[i][j]); // } // printf("\n"); // } // //} //#include <stdio.h> //int main() { // int map[27][27] = {0}, res[27][27] = {0}; // int i, j, t; // // for(i=1; i<=25; i++) { // for(j=1; j<=25; j++) { // scanf("%d", &map[i][j]); // } // } // // for(i=1; i<=25; i++) { // for(j=1; j<=25; j++){ // t = ( map[i-1][j-1]+map[i-1][j]+map[i-1][j+1]+map[i][j-1]+map[i][j+1]+map[i+1][j-1]+map[i+1][j]+map[i+1][j+1] ); // if(map[i][j] == 0){ // if(t==3){ // res[i][j] = 1; // } // } // else{ // if(t==2 || t==3){ // res[i][j] = 1; // } // } // } // } // // // for(i=1; i<=25; i++) { // for(j=1; j<=25; j++) { // printf("%d ", res[i][j]); // } // printf("\n"); // } //} //#include <stdio.h> //int main(){ // int a, b, x, y, z, k, t, s, w; // int h, i, j; // int map[172][172] = {0}, res[172][172] = {0}; // scanf("%d %d %d %d %d", &a, &b, &x, &y, &z); // for(i=1; i<=a; i++){ // for(j=1; j<=b; j++){ // scanf("%d", &map[i][j]); // } // } // scanf("%d", &k); // for(h=0; h<k; h++){ // for(i=1; i<=a; i++){ // for(j=1; j<=b; j++){ // for(s=i-1; s<=i+1; s++) { // for(w=j-1; w<=j+1; w++) { // t += map[s][w]; // } // } // t -= map[i][j]; // // if(map[i][j] == 0){ // if(t == x){ // res[i][j] = 1; // } // } // else{ // if(t>=y && t<z){ // res[i][j] = 1; // } // else{ // res[i][j] = 0; // } // } // t=0; // } // } // // for(i=1; i<=a; i++){ // for(j=1; j<=b; j++){ // map[i][j] = res[i][j]; // res[i][j] = 0; // } // } // } // // // // // for(i=1; i<=a; i++){ // for(j=1; j<=b; j++){ // printf("%d ", map[i][j]); // } // printf("\n"); // } //} #include <stdio.h> int main(){ int r, c; int map[11][11] = {0}; for(i=1; i<=9; i++){ for(j=1; j<=9; j++){ scanf("%d", &map[i][j]); } } scanf("%d %d", &r, &c); if(map[r][c] == 1){ printf("-1"); } }
0
0
2
sararyu07
2022년 10월 25일
In 소스 코드 제출
//#include <stdio.h> // //int main() { // int h, w, n, l, d, x, y, i, j; // int map[101][101] = {0}; // scanf("%d %d", &h, &w); // scanf("%d", &n); // for(i=0; i<n; i++) { // scanf("%d %d %d %d", &l, &d, &x, &y); // if(d==1){ // for(j=0; j<l; j++){ // map[y-1][x+j-1] = 1; // } // } // else { // for(j=0; j<l; j++){ // map[y-1+j][x-1] =1; // } // } // } // // // for(i=0; i<h; i++) { // for(j=0; j<w; j++) { // printf("%d ", map[j][i]); // } // printf("\n"); // } //} //#include<stdio.h> // //int main() { // int map[100][100] = {0}; // int i, j, k=1, n; // // scanf("%d", &n); // // for(i=0; i<n; i++) { // for(j=0; j<n; j++) { // map[i][j] = k++; // // map[i][j] = ++k; // } // } // for(i=0; i<n; i++) { // for(j=0; j<n; j++) { // printf("%d ", map[i][j]); // } // printf("\n"); // } // //} // //#include <stdio.h> // //int main() { // int x=1, y=1; // int i, j; // int map[11][11]; // for(i=0; i<10; i++){ // for(j=0; j<10; j++){ // scanf("%d", &map[i][j]); // } // } // // if(map[x][y] == 2) { // map[x][y] = 9; // } // else{ // map[x][y] = 9; // for(;;) { // if(map[x][y+1] == 0) { // y++; // map[x][y] = 9; // } // else if(map[x][y+1] == 2) { // y++; // map[x][y] = 9; // break; // } // else { // if(map[x+1][y] == 0) { // x++; // map[x][y] = 9; // } // else if (map[x+1][y] == 2){ // x++; // map[x][y] = 9; // break; // } // else{ // break; // } // } // // } // } // // // for(i=0; i<10; i++){ // for(j=0; j<10; j++){ // printf("%d ", map[i][j]); // // } // printf("\n"); // } //} // y = y+1; // if(map[x][y] == 0){ // // map[x][y] = 9; // } // else if(map[x][y] == 1) { // x = x+1; // y = y-1; // if(map[x][y] == 1){ // break; // } // else{ // map[x][y] = 9; // } // // } // else { // map[x][y] = 9; // break; // } //#include <stdio.h> //int main() { // int N, map[21][21] = {0}; // int i, j; // scanf("%d", &N); // for(i=0; i<N; i++){ // scanf("%d", &map[i][0]); // } // for(i=0; i<N; i++){ // for(j=1; j<=i; j++) { // map[i][j] = map[i][j-1] - map[i-1][j-1]; // } // } // for(i=0; i<N; i++){ // for(j=0; j<=i; j++){ // printf("%d ", map[i][j]); // } // printf("\n"); // } //} //#include <stdio.h> // //int main(){ // int map[11][11] = {0}; // int i, j, t=0; // // for(i=0; i<11; i++){ // for(j=0; j<10; j++){ // scanf("%d", &map[i][j]); // } // } // // for(i=0; i<10; i++){ // if(map[10][i] == 1){ // for (j=9; j>=0; j--){ // if(map[j][i] > 0) { // printf("%d ", i+1); // printf("crash"); // break; // } // else if(map[j][i] < 0){ // printf("%d ", i+1); // printf("fall"); // break; // // } // else{ // t++; // } // } // if (j==-1){ // printf("%d ", i+1); // printf("safe"); // t=0; // } // t=0; // printf("\n"); // } // } //} #include <stdio.h> int main() { int n; int map[51][51] = {0}; scanf("%d", &n); map[0][(n+1)/2] = 1; for (i=0; i<n; i++){ i = (n+1)/2 + i + 1; if } } //if(i%3 == 0) { // map[x][y] = i // map[x+1][y] = i+1 //}
0
1
5
sararyu07
2022년 10월 18일
In 소스 코드 제출
//#include <stdio.h> // //int main() { // int n, m, i, j, t; // int arr[10000] // scanf("%d", &n); // for (i=0; i<n; i++) { // scanf("%d", &arr[i]); // } // scanf("%d", &m); // for (j=0; j<m; j++) { // scanf("%d", &arr2[j]); // for(i=0; i<n; i++) { // if (arr2[j] == arr[i]){ // t += 1; // } // } // printf("%d ", t); // t=0; // } // //} //#include <stdio.h> // //int main(){ // int n, m, i, j, t; // int arr[10000001] = {0}; // scanf("%d", &n); // for (i=0; i<n; i++) { // scanf("%d", &t); // arr[t] = arr[t] + 1; // } // scanf("%d", &m); // for (j=0; j<m; j++) { // scanf("%d", &t); // if (arr[t] >= 1) { // printf("1 "); // } // else { // printf("0 "); // } // } // return 0; //} //#include<stdio.h> // //int main() { // int map[100][100] = {0}; // int i, j, k=1, n; // // scanf("%d", &n); // // for(i=0; i<n; i++) { // for(j=0; j<n; j++) { // map[i][j] = k++; // // map[i][j] = ++k; // } // } // // for(i=0; i<n; i++) { // for(j=0; j<n; j++) { // printf("%d ", map[i][j]); // } // printf("\n"); // } // //} //1460~1467 //#include<stdio.h> // //int main() { // int map[101][101] = {0}; // int i, j, n, k=1; // // scanf("%d", &n); // for (i=0; i<n; i++) { // for (j=0; j<n; j++) { // map[i][j] = k++; // } // } // // for (i=0; i<n; i++) { // for (j=0; j<n; j++) { // printf("%d ", map[i][j]); // } // printf("\n"); // } //} //#include <stdio.h> // //int main() { // int map[101][101] = {0}; // int i, j, n, k=1; // // scanf("%d", &n); // // for (i=0; i<n; i++) { // for (j=0; j<n; j++) { // map[i][j] = k++; // } // } // // for (i=0; i<n; i++) { // for (j=n-1; j>=0; j--) { // printf("%d ", map[i][j]); // } // printf("\n"); // } //} //#include <stdio.h> // //int main() { // int map[101][101]; // int i, j, n, k=1; // scanf("%d", &n); // for (i=0; i<n; i++){ // for (j=0; j<n; j++){ // map[i][j] = k++; // } // } // for (i=0; i<n; i++) { // for (j=0; j<n; j++) { // printf("%d ", map[j][i]); // } // printf("\n"); // } //} //#include <stdio.h> //int main() { // int map[101][101]; // int i, j, n, k=1; // scanf("%d", &n); // for (i=0; i<n; i++) { // for (j=0; j<n; j++) { // map[i][j] = k++; // } // } // for (i=n-1; i>=0; i--){ // for (j=0; j<n; j++) { // printf("%d ", map[j][i]); // } // printf("\n"); // } //} //#include <stdio.h> //int main () //{ // int map[101][101]; // int i, j, n, m, k=1; // scanf("%d %d", &n, &m); // for (i=0; i<n; i++){ // for (j=0; j<m; j++){ // map[i][j] = k++; // } // } // for (i=n-1; i>=0; i--){ // for (j=m-1; j>=0; j--){ // printf("%d ", map[i][j]); // } // printf ("\n"); // } //} //#include <stdio.h> // //int main() { // int map[101][101]; // int n, m, i, j, k=1; // scanf("%d %d", &n, &m); // for (i=0; i<n; i++){ // for (j=0; j<m; j++){ // map[i][j] = k++; // } // } // for (i=n-1; i>=0; i--){ // for (j=0; j<m; j++){ // printf("%d ", map[i][j]); // } // printf ("\n"); // } //} //#include <stdio.h> // // int main() { // int map[101][101]; // int n, m, i, j, k=1; // scanf("%d %d", &n, &m); // // for(j=0; j<m; j++) { // for(i=0; i<n; i++) { // map[i][j] = k++; // } // } // // for(i=n-1; i>=0; i--) { // for(j=m-1; j>=0; j--) { // printf("%d ", map[i][j]); // } // printf("\n"); // } // // } /* 1 4 7 10 2 5 8 11 3 6 9 12 */ //#include <stdio.h> // //int main() { // int map[101][101]; // int n, m, i, j, k=1; // // scanf("%d %d", &n, &m); // // for (j=0; j<m; j++){ // for (i=0; i<n; i++) { // map[i][j] = k++; // } // } // // for (i=0; i<n; i++) { // for (j=m-1; j>=0; j--) { // printf("%d ", map[i][j]); // } // printf("\n"); // } //} #include <stdio.h> int main() { int map[101][101] = {0}; int w, h, n, l[], d[], x[], y[]; scanf("%d %d", &w, &h); scanf("%d", &n); for(i=0; i<n; i++){ scanf("%d %d %d %d", &l[i], &d[i], &x[i], &y[i]); } } for (i=0; i<h; i++) { for (j=0; j<w; j++) { if (d[]) } } }
0
0
2
sararyu07
더보기
bottom of page