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
- math
- BFS
- db
- 프로그래머스
- 문제해결
- 문자열
- 백준
- 시뮬레이션
- 코테
- 운동기록
- SQL
- 이분탐색
- MySQL
- 러닝일지
- COS PRO
- priorityqueue
- 문제풀이
- greedy
- 투포인터
- 코딩테스트
- 자바
- 알고리즘
- 건강
- oracle
- binary search
- Java
- SWEA
- DP
- BOJ
- dfs
Archives
- Today
- Total
슈콩
[SWEA] 반반 본문

[문제]
https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AXjS1GXqZ8gDFATi
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));
int T = Integer.parseInt(br.readLine());
for(int tc=1;tc<=T;tc++) {
String word = br.readLine();
int[] cnt = new int[26];
for(int i=0;i<word.length();i++) {
cnt[word.charAt(i)-'A']++;
}
String result = "Yes";
for(int i=0;i<26;i++) {
if(cnt[i]!=2 && cnt[i]!=0) result = "No";
}
System.out.println("#"+tc+" "+result);
}
}
}'Algorithms > SWEA' 카테고리의 다른 글
| [SWEA] 홀수일까 짝수일까 (0) | 2025.11.17 |
|---|---|
| [SWEA] 계산기 (0) | 2025.11.17 |
| [SWEA] 구구단 1 (0) | 2025.11.17 |
| [SWEA] 구독자 전쟁 (0) | 2025.11.17 |
| [SWEA] XY 문자열 1 (0) | 2025.11.17 |