전체 글
-
[python]백준 박사 과정 5026번알고리즘 문제풀이/백준(파이썬) 2023. 5. 19. 21:41
코드 import sys sys.stdin = open("5026.txt", "r") t=int(input()) for _ in range(t): q=input() if q=="P=NP": print('skipped') continue else: print(sum(map(int,q.split("+")))) 링크 https://www.acmicpc.net/problem/5026 5026번: 박사 과정 첫째 줄에 문제의 개수 N이 주어진다. (1 ≤ N ≤ 1000) 다음 N개 줄에는 "a+b"형식의 덧셈 문제나 "P=NP"가 주어진다. a,b ∈ [0,1000]이며 a와 b는 정수이다. www.acmicpc.net
-
[java]백준 과제 안 내신 분..? 5597번알고리즘 문제풀이/백준(자바) 2023. 5. 19. 21:38
코드 import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Scanner; public class BOJ_5597 { public static int[] removeDuplicates(int[] arr) { return Arrays.stream(arr).distinct().toArray(); } public static void main(String[] args) { Scanner in = new Scanner(System.in); List a=new ArrayList(); List b=new ArrayList(); for (int i = 0; i < 28; i++) { a.add(in.nex..
-
[python]백준 욱제는 효도쟁이야!! 14487번알고리즘 문제풀이/백준(파이썬) 2023. 5. 18. 20:55
코드 import sys sys.stdin = open("14487.txt", "r") n=int(input()) q=list(map(int,input().split())) q.remove(max(q)) print(sum(q)) 링크 https://www.acmicpc.net/problem/14487 14487번: 욱제는 효도쟁이야!! 욱제는 KOI를 망친 기념으로 부모님과 함께 코드게이트 섬으로 여행을 떠났다. 코드게이트 섬에는 오징어로 유명한 준오마을(심술쟁이 해커 임준오 아님), 밥으로 유명한 재훈마을, 영중마을 등 www.acmicpc.net
-
[java]백준 자동완성 24883번알고리즘 문제풀이/백준(자바) 2023. 5. 18. 20:54
코드 import java.util.Scanner; public class BOJ_24883 { public static void main(String[] args) { Scanner in = new Scanner(System.in); String a=in.next(); if (a.equals("n") || a.equals("N")) { System.out.println("Naver D2"); }else{ System.out.println("Naver Whale"); } in.close(); } } 링크 https://www.acmicpc.net/problem/24883 24883번: 자동완성 D2는 For Developers, By Developers의 약자로, 개발자들을 위해 개발자들이 직접 만들어 ..
-
[java]백준 심부름 가는 길 5554번알고리즘 문제풀이/백준(자바) 2023. 5. 17. 23:55
코드 import java.util.Scanner; public class BOJ_5554 { public static void main(String[] args) { Scanner in = new Scanner(System.in); int s=0; for (int i = 0; i < 4; i++) { s+=in.nextInt(); } int a=s/60; int b=s%60; System.out.println(a); System.out.println(b); in.close(); } } 링크 https://www.acmicpc.net/problem/5554 5554번: 심부름 가는 길 승균이는 매일 학교, PC방, 학원에 다닌다. 반복되는 일상에 익숙해진 승균이는 이동시간을 단축해서 PC방에 더 오래 머..
-
[python]백준 심부름 가는 길 5554번알고리즘 문제풀이/백준(파이썬) 2023. 5. 17. 23:53
코드 import sys sys.stdin = open("5554.txt", "r") s=0 for i in range(4): s+=int(input()) print(s//60) print(s%60) 링크 https://www.acmicpc.net/problem/5554 5554번: 심부름 가는 길 승균이는 매일 학교, PC방, 학원에 다닌다. 반복되는 일상에 익숙해진 승균이는 이동시간을 단축해서 PC방에 더 오래 머물고 싶었다. 그래서 스톱워치를 들고 이동할 때마다 기록을 잰 후 집 www.acmicpc.net
-
[python]백준 점수계산 2506번알고리즘 문제풀이/백준(파이썬) 2023. 5. 16. 23:52
코드 import sys sys.stdin = open("2506.txt", "r") t=int(input()) a,b=0,0 s=list(map(int,input().split())) for j in range(t): if s[j]==1: a+=1 b+=a else: a=0 print(b) 링크 https://www.acmicpc.net/problem/2506 2506번: 점수계산 OX 문제는 맞거나 틀린 두 경우의 답을 가지는 문제를 말한다. 여러 개의 OX 문제로 만들어진 시험에서 연속적으로 답을 맞히는 경우에는 가산점을 주기 위해서 다음과 같이 점수 계산을 하기로 www.acmicpc.net