fragment-header
fragment-markdown
홈
로그인
로그아웃
내 블로그
설정
로그인
Codeforces Round 1062-A (Div. 4) Square?
최초 업로드: 2025-10-28 22:00:52
최근 수정 시간: 2025-10-28 22:02:24
게시자: rlatjwls3333
카테고리: Codeforces
조회수: 10
# A. Square? [문제 링크](https://codeforces.com/contest/2167/problem/A) ## Problem Statement You are given $4$ sticks of lengths $a$, $b$, $c$, and $d$. You can not break or bend them. Determine whether it is possible to form a square using the given sticks. ## Input The first line contains a single integer $t$ ($1 \le t \le 10^4$) — the number of test cases. The only line of each test case contains four integers $a$, $b$, $c$, and $d$ ($1 \le a, b, c, d \le 10$) — the lengths of the sticks. ## Output For each test case, print "YES" if it is possible to form a square using the given sticks, and "NO" otherwise. You may print each letter in any case (uppercase or lowercase). For example, the strings "yEs", "yes", "Yes", and "YES" will all be recognized as a positive answer. ## Footnote *square* is defined as a polygon consisting of $4$ vertices, of which all sides have equal length and all inner angles are equal. No two edges of the polygon may intersect each other. ## 풀이 입력되는 네 수가 같은지 확인하면 됩니다. ``` c++ #include<bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); int t; cin >> t; while(t--) { int a, b, c, d; cin >> a >> b >> c >> d; cout << (a==b && b==c && c==d ? "YES\n" : "NO\n"); } } ```