FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-for-coding-test/7/7.java at master · ndb796/python-for-coding-test · GitHub
ndb796
/
python-for-coding-test
Public
Notifications
You must be signed in to change notification settings
Fork
831
Star
2.4k
Code
Issues
129
Pull requests
1
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
python-for-coding-test
/
7
/
7.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
36 lines (30 loc) · 1001 Bytes
Breadcrumbs
python-for-coding-test
/
7
/
7.java
Copy path
File metadata and controls
36 lines (30 loc) · 1001 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
import
java
.
util
.*;
public
class
Main
{
public
static
void
main
(
String
[]
args
) {
Scanner
sc
=
new
Scanner
(
System
.
in
);
// N(가게의 부품 개수)
int
n
=
sc
.
nextInt
();
// 집합(Set) 정보를 처리하기 위한 HashSet 라이브러리
HashSet
<
Integer
>
s
=
new
HashSet
<>();
for
(
int
i
=
0
;
i
<
n
;
i
++) {
int
x
=
sc
.
nextInt
();
s
.
add
(
x
);
}
// M(손님이 확인 요청한 부품 개수)
int
m
=
sc
.
nextInt
();
int
[]
targets
=
new
int
[
n
];
for
(
int
i
=
0
;
i
<
m
;
i
++) {
targets
[
i
] =
sc
.
nextInt
();
}
// 손님이 확인 요청한 부품 번호를 하나씩 확인
for
(
int
i
=
0
;
i
<
m
;
i
++) {
// 해당 부품이 존재하는지 확인
if
(
s
.
contains
(
targets
[
i
])) {
System
.
out
.
print
(
"yes "
);
}
else
{
System
.
out
.
print
(
"no "
);
}
}
}
}
Back
|
FazBrowse Home
|
New Git URL