SW Expert Academy
SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요!
swexpertacademy.com
문제 접근법 : 굉장히 쉬운문제입니다. 입력된 문자중에 중복된 문자가 있는지만 확인하면 되는문제니
따로 생각할 문제가 없었습니다.
소스코드:
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
32
33
34
35
36
37
38
|
//By 콩순이냉장고
#include <string>
#include <vector>
#include <unordered_map>
#include <iostream>
#include <cstring>
#include <queue>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int te;
cin >> te;
for (int test = 1; test <= te; test++)
{
int n;
cin >> n;
int visit[100001] = { 0 };
int flag = true;
for (int i = 0; i < n; i++)
{
int a;
cin >> a;
if (!visit[a])
visit[a] = 1;
else
flag = false;
}
if (flag)
cout << "#" << test << " Yes\n";
else
cout << "#" << test << " No\n";
}
}
|
cs |
모르는점 혹은 궁금한점 혹은 코드의 문제점이있다면 언제든지 댓글을 이용해주시길 부탁드립니다.
'SWEA' 카테고리의 다른 글
[SWEA] 5653 줄기세포배양(모의 SW 역량테스트) (0) | 2020.09.28 |
---|---|
[SWEA] 4013 특이한 자석 (모의 SW 역량테스트) (0) | 2020.09.27 |
[SWEA] 7792 반장 선출 (0) | 2020.09.15 |
[SWEA] 4615 재미있는 오셀로 게임 (0) | 2020.09.15 |
[SWEA] 9708 가장 긴 수열 (0) | 2020.08.11 |