Skip to content

Instantly share code, notes, and snippets.

View dev-GOHU's full-sized avatar

GOHU dev-GOHU

  • 한서대학교 항공컴퓨터전공
  • Republic of Korea
  • X @dev_gohu
View GitHub Profile
import matplotlib.pyplot as plt
import numpy as np
def graph(x, y):
# 그래프 생성
fig, ax = plt.subplots()
# x축과 y축 그리기
ax.spines['left'].set_position('center')
ax.spines['bottom'].set_position('center')
n = int(input())
parent=list(map(int, input().split(' ')))
#parent의 element 중 deleted_node가 있으면 제거
def removeNode(deleted_node, parent):
parent[deleted_node]=None #노드 제거
for i in range(len(parent)):
if parent[i]==deleted_node:
removeNode(i, parent)
@dev-GOHU
dev-GOHU / programmers-더_맵게.py
Created February 8, 2023 06:46
프로그래머스의 힙(Heap) 문제인 더 맵게 문제의 코드입니다.
import heapq
def solution(scoville, K):
answer = 0
heapq.heapify(scoville)
if scoville[0]>=K:
return answer
while True:
heapq.heappush(scoville, heapq.heappop(scoville)+(heapq.heappop(scoville)*2))
answer+=1
@dev-GOHU
dev-GOHU / uni_Java - Week14 project.java
Last active December 27, 2022 14:25
수업 안드로이드프로그래밍 14주차 과제
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.util.HashMap;
import java.util.Scanner;
public class elevator {
int minFloor;
int maxFloor;
@dev-GOHU
dev-GOHU / uni_Java - Week12 project.java
Created December 27, 2022 14:24
수업 안드로이드프로그래밍 12주차 과제
public class project{
public static void main(String[] args) {
// TODO Auto-generated method stub
for(int i=2 ; i<=99 ; i++) {
System.out.println("*** "+i+"단 ***");
for(int j=1 ; j<=99 ; j++) {
System.out.println(i+" × "+j+" = "+(i*j));
}
}
}
@dev-GOHU
dev-GOHU / uni_Java - Week10 project.java
Created December 27, 2022 14:23
수업 안드로이드프로그래밍 10주차 과제
import java.util.Scanner;
public class project {
public static void main(String[] args) throws Exception {
// TODO Auto-generated method stub
Scanner scanner = new Scanner(System.in);
String inputData;
while(true) {
inputData=scanner.nextLine();
@dev-GOHU
dev-GOHU / uni_Java - Week4 project.java
Created December 27, 2022 14:21
수업 안드로이드프로그래밍 4주차 과제
package project1;
public class project {
public static void main(String[] args) {
// TODO Auto-generated method stub
//float var1_1=1.3; //Compile Error!
float var1_2=2.5f;
float var1_3=3.9F;
install.packages('readxl')
install.packages('dplyr')
install.packages('treemap')
library(readxl)
library(treemap)
library(dplyr)
setwd('C:/University_Project/R/finalTest')
baker <- read_excel('기말고사_공공데이터_1차가공.xlsx')
head(baker)
@dev-GOHU
dev-GOHU / uni_Python - week11 project 2-1.py
Created December 27, 2022 14:00
수업 파이썬프로그래밍 11주차 과제
def func(x):
print(x)
pass
func(5)
@dev-GOHU
dev-GOHU / uni_Python - chap 8-10.py
Created December 27, 2022 13:55
교재 파이썬 for beginner(3판) 8장 연습문제 과제입니다.
ss = "IT_CookBook"
'#'.join(ss)