Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | |||||
| 3 | 4 | 5 | 6 | 7 | 8 | 9 |
| 10 | 11 | 12 | 13 | 14 | 15 | 16 |
| 17 | 18 | 19 | 20 | 21 | 22 | 23 |
| 24 | 25 | 26 | 27 | 28 | 29 | 30 |
| 31 |
Tags
- SQL
- priorityqueue
- 문제풀이
- 코테
- 알고리즘
- BOJ
- DP
- 러닝일지
- Java
- MySQL
- 운동기록
- BFS
- 코딩테스트
- 백준
- greedy
- COS PRO
- oracle
- db
- 프로그래머스
- binary search
- 문제해결
- math
- 이분탐색
- dfs
- 시뮬레이션
- 자바
- 문자열
- 투포인터
- 건강
- SWEA
Archives
- Today
- Total
슈콩
[SWEA] 순열1 본문

[문제]
https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AXHx23oq0REDFAXR
SW Expert Academy
SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요!
swexpertacademy.com
[소스 코드]
import java.io.*;
import java.util.*;
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st;
int T = Integer.parseInt(br.readLine());
for(int tc=1;tc<=T;tc++) {
int n = Integer.parseInt(br.readLine());
HashSet<Integer> hs = new HashSet<>();
st = new StringTokenizer(br.readLine());
for(int i=0;i<n;i++) {
hs.add(Integer.parseInt(st.nextToken()));
}
boolean check = true;
for(int i=1;i<=n;i++) {
if(!hs.contains(i)) {
check = false;
break;
}
}
if(check) System.out.println("#"+tc+" Yes");
else System.out.println("#"+tc+" No");
}
}
}'Algorithms > SWEA' 카테고리의 다른 글
| [SWEA] 다솔이의 월급 상자 (0) | 2025.11.21 |
|---|---|
| [SWEA] 부먹왕국의 차원 관문 (0) | 2025.11.20 |
| [SWEA] 과자 분배 (0) | 2025.11.20 |
| [SWEA] 집합 비교 (0) | 2025.11.20 |
| [SWEA] 새샘이와 세 소수 (0) | 2025.11.20 |