이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const int maxn = 100010;
int n, q, p[3][maxn], tmp[3][maxn];
int main() {
ios::sync_with_stdio(0), cin.tie(0);
cin >> n >> q;
for (int i : {0, 1, 2}) {
for (int j = 1; j <= n; j++) {
cin >> p[i][j], tmp[i][p[i][j]] = j;
}
}
while (q--) {
int op, x, y, z;
cin >> op >> x;
if (op == 1) {
set<int> S;
for (int i = 1; i <= n; i++) {
for (int j : {0, 1, 2}) {
S.insert(p[j][i]);
}
if (S.size() == i) {
cout << (S.count(x) ? "DA\n" : "NE\n"); break;
}
}
} else {
cin >> y >> z, x--;
swap(p[x][tmp[x][y]], p[x][tmp[x][z]]);
swap(tmp[x][y], tmp[x][z]);
}
}
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
tenis.cpp: In function 'int main()':
tenis.cpp:24:30: warning: comparison of integer expressions of different signedness: 'std::set<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
24 | if (S.size() == i) {
| ~~~~~~~~~^~~~
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |