QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#54985#1266. Visual CubeYaoBIG#AC ✓3ms3632kbC++1.1kb2022-10-11 20:15:322022-10-11 20:15:34

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-10-11 20:15:34]
  • 评测
  • 测评结果:AC
  • 用时:3ms
  • 内存:3632kb
  • [2022-10-11 20:15:32]
  • 提交

answer

#include "bits/stdc++.h"
#define rep(i, a, n) for (auto i = a; i <= (n); i++)
#define revrep(i, a, n) for (auto i = n; i >= (a); i++)
#define all(a) a.begin(), a.end()
#define sz(a) (int)(a).size()

using namespace std;
using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;


int main() {
	ios::sync_with_stdio(0); cin.tie(0);

	int cas; cin >> cas; while (cas--) {
		int a, b, c; cin >> a >> b >> c;
		vector<string> ans(c * 2 + b * 2 + 1, string(b * 2 + a * 2 + 1, '.'));
		rep(i, 0, b) {
			int off = (b - i) * 2;

			rep(j, 0, a) ans[i * 2][off + j * 2] = '+';
			rep(j, 0, a - 1) ans[i * 2][off + j * 2 + 1] = '-';
			if (i < b) rep(j, 0, a) ans[i * 2 + 1][off + j * 2 - 1] = '/';
		}
		rep(i, 0, c) {
			rep(j, 0, a) ans[b * 2 + i * 2][j * 2] = '+';
			if (i < c) rep(j, 0, a) ans[b * 2 + i * 2 + 1][j * 2] = '|';
			rep(j, 0, a - 1) ans[b * 2 + i * 2][j * 2 + 1] = '-';

			rep(j, 0, b) ans[b * 2 + i * 2 - j * 2][a * 2 + j * 2] = '+';
			if (i < c) rep(j, 0, b) ans[b * 2 + i * 2 - j * 2 + 1][a * 2 + j * 2] = '|';
			rep(j, 0, b - 1) ans[b * 2 + i * 2 - j * 2 - 1][a * 2 + j * 2 + 1] = '/';
		}
		for (auto &s: ans) puts(s.c_str());
	}
	return 0;
}

详细

Test #1:

score: 100
Accepted
time: 2ms
memory: 3568kb

input:

2
1 1 1
6 2 4

output:

..+-+
././|
+-+.+
|.|/.
+-+..
....+-+-+-+-+-+-+
.../././././././|
..+-+-+-+-+-+-+.+
./././././././|/|
+-+-+-+-+-+-+.+.+
|.|.|.|.|.|.|/|/|
+-+-+-+-+-+-+.+.+
|.|.|.|.|.|.|/|/|
+-+-+-+-+-+-+.+.+
|.|.|.|.|.|.|/|/.
+-+-+-+-+-+-+.+..
|.|.|.|.|.|.|/...
+-+-+-+-+-+-+....

result:

ok 18 lines

Test #2:

score: 0
Accepted
time: 3ms
memory: 3632kb

input:

50
16 19 7
1 8 12
5 15 16
12 9 14
9 2 11
8 11 8
2 1 20
8 16 3
2 7 1
3 17 7
13 13 11
5 9 5
11 10 3
19 4 6
13 17 9
9 17 8
14 3 11
9 4 2
9 6 5
4 9 1
12 8 18
4 7 2
13 3 9
1 13 17
17 11 3
9 2 13
5 7 2
6 18 14
14 14 11
5 12 14
16 7 1
5 19 10
16 9 1
9 8 6
11 7 18
12 20 10
10 16 13
17 12 9
9 9 17
10 2 12
1 ...

output:

......................................+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
...................................../././././././././././././././././|
....................................+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+.+
.................................../././././././././././././././././|/|
...............

result:

ok 1988 lines