QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#258259 | #7687. Randias Permutation Task | Fr1nGeLove | WA | 1ms | 3464kb | C++20 | 638b | 2023-11-19 16:29:58 | 2023-11-19 16:29:58 |
Judging History
answer
#include <bits/stdc++.h>
using i64 = long long;
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int n, m;
std::cin >> n >> m;
std::set<std::vector<int>> f;
std::vector a(m, std::vector<int>(n));
for (int i = 0; i < m; i++) {
for (int j = 0; j < n; j++) {
std::cin >> a[i][j];
a[i][j]--;
}
}
for (int i = 0; i < m; i++) {
auto g = f;
for (auto x : f) {
std::vector<int> y(n);
for (int j = 0; j < n; j++) {
y[j] = x[a[i][j]];
}
g.insert(y);
}
g.insert(a[0]);
std::swap(f, g);
}
std::cout << int(f.size()) << "\n";
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3464kb
input:
5 4 1 2 3 4 5 5 1 3 4 2 3 4 1 5 2 5 2 4 1 3
output:
8
result:
ok 1 number(s): "8"
Test #2:
score: 0
Accepted
time: 0ms
memory: 3388kb
input:
2 1 2 1
output:
1
result:
ok 1 number(s): "1"
Test #3:
score: 0
Accepted
time: 0ms
memory: 3448kb
input:
1 180 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
output:
1
result:
ok 1 number(s): "1"
Test #4:
score: 0
Accepted
time: 0ms
memory: 3420kb
input:
180 1 52 71 167 89 165 102 119 125 9 128 180 24 48 172 108 22 164 28 159 111 30 91 67 51 136 97 126 133 177 65 115 157 114 11 171 178 23 127 163 103 99 18 56 94 176 77 44 1 124 74 61 87 4 40 63 92 169 84 146 6 88 55 152 49 10 90 43 174 70 50 69 154 73 147 110 20 82 59 112 12 64 143 16 138 5 170 155 ...
output:
1
result:
ok 1 number(s): "1"
Test #5:
score: 0
Accepted
time: 1ms
memory: 3388kb
input:
2 90 1 2 1 2 1 2 1 2 2 1 2 1 2 1 2 1 1 2 2 1 1 2 1 2 1 2 2 1 2 1 2 1 2 1 1 2 1 2 1 2 1 2 2 1 1 2 2 1 1 2 1 2 1 2 2 1 2 1 1 2 2 1 1 2 2 1 1 2 1 2 2 1 1 2 2 1 2 1 2 1 2 1 1 2 2 1 2 1 2 1 2 1 1 2 1 2 2 1 2 1 1 2 1 2 1 2 2 1 1 2 2 1 2 1 1 2 2 1 2 1 2 1 2 1 2 1 2 1 2 1 1 2 1 2 1 2 2 1 1 2 1 2 2 1 1 2 1 2...
output:
2
result:
ok 1 number(s): "2"
Test #6:
score: -100
Wrong Answer
time: 0ms
memory: 3436kb
input:
90 2 43 44 28 69 66 18 5 23 87 8 24 89 31 29 81 1 68 2 78 53 49 54 4 13 77 61 33 57 63 85 55 79 46 35 45 64 65 42 30 6 19 74 82 80 17 26 32 59 7 72 16 3 47 73 39 36 25 34 56 86 71 62 84 40 41 11 50 27 20 14 37 12 38 58 48 83 76 70 51 88 22 90 21 9 10 60 15 52 75 67 9 73 52 51 81 16 71 77 6 57 11 75 ...
output:
2
result:
wrong answer 1st numbers differ - expected: '3', found: '2'