Task: | Trojke |
Sender: | henrikaalto |
Submission time: | 2019-07-24 14:34:07 +0300 |
Language: | C++ (C++17) |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
test | verdict | time | |
---|---|---|---|
#1 | ACCEPTED | 0.01 s | details |
#2 | ACCEPTED | 0.01 s | details |
#3 | WRONG ANSWER | 0.01 s | details |
#4 | WRONG ANSWER | 0.01 s | details |
#5 | WRONG ANSWER | 0.01 s | details |
#6 | WRONG ANSWER | 0.01 s | details |
#7 | WRONG ANSWER | 0.01 s | details |
#8 | WRONG ANSWER | 0.01 s | details |
#9 | WRONG ANSWER | 0.01 s | details |
#10 | WRONG ANSWER | 0.01 s | details |
Code
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<string> v(n); for (int i = 0; i < n; ++i) { cin >> v[i]; } vector<vector<int>> s; for (int i = 0; i < n; ++i) { for (int j = 0; j < n; ++j) { if (v[i][j] == '.') continue; for (int it = 0; it < n; ++it) { for (int jt = 0; jt < n; ++jt) { if (v[it][jt] == '.') continue; if (it == i && jt == j) continue; int ix = it - i; int jx = jt - j; for (int x = 1; x < n; ++x) { int ih = it + ix * x; int jh = jt + jx * x; if (ih < 0 || ih >= n) continue; if (jh < 0 || jh >= n) continue; if (v[ih][jh] == '.') continue; vector<int> lol = {v[i][j], v[it][jt], v[ih][jh]}; sort(lol.begin(), lol.end()); // for (auto u : lol) cout << u << " ";cout<<"\n\n"; s.push_back(lol); } } } } } sort(s.begin(), s.end()); s.resize(unique(s.begin(), s.end()) - s.begin()); cout << s.size() << "\n"; }
Test details
Test 1
Verdict: ACCEPTED
input |
---|
3
AB. .CD ..E |
correct output |
---|
1 |
user output |
---|
1 |
Test 2
Verdict: ACCEPTED
input |
---|
5
A.G.H ..... B.C.I ..... ... |
correct output |
---|
8 |
user output |
---|
8 |
Test 3
Verdict: WRONG ANSWER
input |
---|
8
..HK.... .....C.. .......J E...B... ... |
correct output |
---|
10 |
user output |
---|
9 |
Test 4
Verdict: WRONG ANSWER
input |
---|
10
.......... ....WZ.... ......I... ...A...... ... |
correct output |
---|
7 |
user output |
---|
6 |
Test 5
Verdict: WRONG ANSWER
input |
---|
30
................................. |
correct output |
---|
14 |
user output |
---|
8 |
Test 6
Verdict: WRONG ANSWER
input |
---|
50
................................. |
correct output |
---|
6 |
user output |
---|
4 |
Test 7
Verdict: WRONG ANSWER
input |
---|
80
................................. |
correct output |
---|
97 |
user output |
---|
43 |
Test 8
Verdict: WRONG ANSWER
input |
---|
90
................................. |
correct output |
---|
81 |
user output |
---|
32 |
Test 9
Verdict: WRONG ANSWER
input |
---|
99
................................. |
correct output |
---|
148 |
user output |
---|
23 |
Test 10
Verdict: WRONG ANSWER
input |
---|
100
................................. |
correct output |
---|
132 |
user output |
---|
46 |