Skip to content

Instantly share code, notes, and snippets.

View dalcon10028's full-sized avatar
๐Ÿ 
Working from home

Corn(์ด์—ฐ๊ถŒ) dalcon10028

๐Ÿ 
Working from home
View GitHub Profile
# -*- coding: utf-8 -*-
# ๋ฌธ์ œ 1
traffic_code = [0, 9, 5]
def is_traffic_code(input_value):
return 0 <= input_value and input_value <= 2
while True:
first = input('์ฒซ ๋ฒˆ์งธ ๊ตํ†ต์ˆ˜๋‹จ (์ฝ”๋“œ)๋ฅผ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”!')
package com.company;
import java.io.*;
import java.util.*;
public class Main {
static int[][] memo = new int[41][2];
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringBuilder sb = new StringBuilder();
@dalcon10028
dalcon10028 / 4์ฃผ์ฐจ ์Šคํƒ๊ณผ ์žฌ๊ท€.c
Last active July 20, 2020 04:35
4์ฃผ์ฐจ ์Šคํƒ๊ณผ ์žฌ๊ท€
/*
------------------------------
| ์Šคํƒ |
------------------------------
*/
#include <stdio.h>
#include <string.h>
// ์‚ฌ์šฉํ•  ํ•จ์ˆ˜๋“ค์„ ์„ ์–ธํ•ฉ๋‹ˆ๋‹ค.
void push(int n), menu();
@dalcon10028
dalcon10028 / 4์ฃผ์ฐจ.java
Created July 14, 2020 01:15
4์ฃผ์ฐจ ์†Œ์Šค์ฝ”๋“œ
// 10809๋ฒˆ ์•Œ๋ฐ”ํŽซ ์ฐพ๊ธฐ
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String str = sc.next();
for (char i = 'a'; i<='z' ; i++)
System.out.print(str.indexOf(i) + " ");
}
@dalcon10028
dalcon10028 / 3์ฃผ์ฐจ.c
Created July 8, 2020 00:50
3์ฃผ์ฐจ ์†Œ์Šค์ฝ”๋“œ
// 2741๋ฒˆ N ์ฐ๊ธฐ
#include <stdio.h>
int main() {
int a,i ;
scanf("%d",&a);
for(i=1; i<=a; i++)
printf("%d\n",i);
return 0;
}
@dalcon10028
dalcon10028 / ๋‚˜๋ˆ„์–ด ๋–จ์–ด์ง€๋Š” ์ˆซ์ž ๋ฐฐ์—ด.java
Created July 7, 2020 14:31
ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค ์ฝ”๋”ฉํ…Œ์ŠคํŠธ ์—ฐ์Šต Level1 - ๋‚˜๋ˆ„์–ด ๋–จ์–ด์ง€๋Š” ์ˆซ์ž ๋ฐฐ์—ด [ Java ]
import java.util.*;
class Solution {
public int[] solution(int[] arr, int divisor) {
LinkedList<Integer> list = new LinkedList<>();
Arrays.sort(arr);
for (int i : arr)
if(i%divisor==0)
list.add(i);
if(list.isEmpty()) list.add(-1);
return list.stream().mapToInt(i->i).toArray();
@dalcon10028
dalcon10028 / ๊ฐ™์€ ์ˆซ์ž๋Š” ์‹ซ์–ด.java
Created July 7, 2020 11:29
ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค ์ฝ”๋”ฉํ…Œ์ŠคํŠธ ์—ฐ์Šต Level1 - ๊ฐ™์€ ์ˆซ์ž๋Š” ์‹ซ์–ด [ Java ]
import java.util.LinkedList;
public class Solution {
public static void main(String[] args) {
int[] arr = new int[]{1, 1, 3, 3, 0, 1, 1};
int[] r = solution(arr);
for (int i : r)
System.out.println(i);
}
@dalcon10028
dalcon10028 / ๊ฐ€์šด๋ฐ ๊ธ€์ž ๊ฐ€์ ธ์˜ค๊ธฐ.java
Created July 7, 2020 10:50
ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค ์ฝ”๋”ฉํ…Œ์ŠคํŠธ ์—ฐ์Šต Level1 - ๊ฐ€์šด๋ฐ ๊ธ€์ž ๊ฐ€์ ธ์˜ค๊ธฐ [ Java ]
class Solution {
public String solution(String s) {
int half = s.length()/2;
return s.length()%2==0 ? s.substring(half-1, half+1) : s.substring(half,half+1);
}
}
@dalcon10028
dalcon10028 / ํฌ๋ ˆ์ธ ์ธํ˜•๋ฝ‘๊ธฐ ๊ฒŒ์ž„.java
Created July 7, 2020 10:23
ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค ์ฝ”๋”ฉํ…Œ์ŠคํŠธ ์—ฐ์Šต Level1 - ํฌ๋ ˆ์ธ ์ธํ˜•๋ฝ‘๊ธฐ ๊ฒŒ์ž„ [ Java ]
import java.util.Stack;
public class Solution {
public static void main(String[] args) {
int[][] board = new int[][]{{0,0,0,0,0},{0,0,1,0,3},{0,2,5,0,1},{4,2,4,4,2},{3,5,1,3,1}};
int[] moves = new int[]{1,5,3,5,1,2,1,4};
System.out.println(solution(board, moves));
}
static int solution(int[][] board, int[] moves) {
int score = 0;
@dalcon10028
dalcon10028 / 2016๋…„.java
Created July 7, 2020 09:12
ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค ์ฝ”๋”ฉํ…Œ์ŠคํŠธ ์—ฐ์Šต Level1 - 2016๋…„ [ Java ]
class Solution {
public String solution(int a, int b) {
String[] week = new String[] {"THU","FRI","SAT","SUN","MON","TUE","WED"};
int[] month = new int[] {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int cal = 0;
for(int i=0; i<a-1; i++)
cal+=month[i];
return week[(cal+b)%7];
}
}