문제
https://www.acmicpc.net/problem/10874
코드
#include <iostream>
using namespace std;
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
int n, a;
cin >> n;
for (int i = 1; i <= n; i++) {
int cnt = 0;
for (int j = 1; j <= 10; j++) {
cin >> a;
if ((j - 1) % 5 + 1 == a)
cnt++;
}
if (cnt == 10)
cout << i << '\n';
}
return 0;
}'PS > Baekjoon' 카테고리의 다른 글
| [백준] 30676: 이 별은 무슨 색일까(C++) (1) | 2025.08.09 |
|---|---|
| [백준] 11319: Count Me In(C++) (0) | 2025.06.24 |
| [백준] 32025: 체육은 수학과목 입니다(C++) (0) | 2025.05.08 |
| [백준] 16395: 파스칼의 삼각형(C++) (0) | 2025.04.29 |
| [백준] 9625: BABBA(C++) (0) | 2025.04.26 |
댓글