Task: | Fraktaali |
Sender: | Ilmari2000 |
Submission time: | 2017-10-12 20:29:42 +0300 |
Language: | C++ |
Status: | READY |
Result: | 10 |
group | verdict | score |
---|---|---|
#1 | ACCEPTED | 10 |
#2 | WRONG ANSWER | 0 |
#3 | WRONG ANSWER | 0 |
#4 | WRONG ANSWER | 0 |
#5 | WRONG ANSWER | 0 |
#6 | WRONG ANSWER | 0 |
#7 | WRONG ANSWER | 0 |
#8 | WRONG ANSWER | 0 |
#9 | WRONG ANSWER | 0 |
#10 | WRONG ANSWER | 0 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | ACCEPTED | 0.04 s | 1 | details |
#2 | WRONG ANSWER | 0.06 s | 2 | details |
#3 | WRONG ANSWER | 0.05 s | 3 | details |
#4 | WRONG ANSWER | 0.06 s | 4 | details |
#5 | WRONG ANSWER | 0.05 s | 5 | details |
#6 | WRONG ANSWER | 0.05 s | 6 | details |
#7 | WRONG ANSWER | 0.04 s | 7 | details |
#8 | WRONG ANSWER | 0.05 s | 8 | details |
#9 | WRONG ANSWER | 0.04 s | 9 | details |
#10 | WRONG ANSWER | 0.05 s | 10 | details |
Code
#include <iostream> #include <vector> using namespace std; vector<vector<int>> fractal(int d) { vector<vector<int>> ret; if(d <= 1) { ret.resize(1); ret[0].resize(1); ret[0][0] = 0; } else { vector<vector<int>> prev = fractal(d - 1); prev[prev.size() - 1][prev.size() - 1] = !prev[prev.size() - 1][prev.size() - 1]; ret.resize(prev.size() * 2); for(unsigned int i = 0; i < ret.size(); i++) { ret[i].resize(ret.size()); } for(unsigned int i = 0; i < prev.size(); i++) { for(unsigned int j = 0; j < prev[i].size(); j++) { ret[i][j] = prev[i][j]; ret[i + prev.size()][j] = prev[i][j]; ret[i + prev.size()][j + prev.size()] = prev[i][j]; ret[i][j + prev.size()] = prev[i][j]; } } //ret[ret.size() - 1][ret.size() - 1] = !ret[ret.size() - 1][ret.size() - 1]; } return ret; } int main() { int d; cin >> d; vector<vector<int>> f = fractal(d); for(unsigned int i = 0; i < f.size(); i++) { for(unsigned int j = 0; j < f[i].size(); j++) { std::cout << (f[i][j] ? '.' : '#'); } std::cout << endl; } }
Test details
Test 1
Group: 1
Verdict: ACCEPTED
input |
---|
1 |
correct output |
---|
# |
user output |
---|
# |
Test 2
Group: 2
Verdict: WRONG ANSWER
input |
---|
2 |
correct output |
---|
## #. |
user output |
---|
.. .. |
Test 3
Group: 3
Verdict: WRONG ANSWER
input |
---|
3 |
correct output |
---|
#### #.#. ##.. #..# |
user output |
---|
.... .#.# .... .#.# |
Test 4
Group: 4
Verdict: WRONG ANSWER
input |
---|
4 |
correct output |
---|
######## #.#.#.#. ##..##.. #..##..# ####.... ... |
user output |
---|
........ .#.#.#.# ........ .#...#.. ........ ... |
Test 5
Group: 5
Verdict: WRONG ANSWER
input |
---|
5 |
correct output |
---|
################ #.#.#.#.#.#.#.#. ##..##..##..##.. #..##..##..##..# ####....####.... ... |
user output |
---|
................ .#.#.#.#.#.#.#.# ................ .#...#...#...#.. ................ ... |
Test 6
Group: 6
Verdict: WRONG ANSWER
input |
---|
6 |
correct output |
---|
##############################... |
user output |
---|
................................. |
Test 7
Group: 7
Verdict: WRONG ANSWER
input |
---|
7 |
correct output |
---|
##############################... |
user output |
---|
................................. |
Test 8
Group: 8
Verdict: WRONG ANSWER
input |
---|
8 |
correct output |
---|
##############################... |
user output |
---|
................................. |
Test 9
Group: 9
Verdict: WRONG ANSWER
input |
---|
9 |
correct output |
---|
##############################... |
user output |
---|
................................. |
Test 10
Group: 10
Verdict: WRONG ANSWER
input |
---|
10 |
correct output |
---|
##############################... |
user output |
---|
................................. |