QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#653126#1266. Visual Cubef_rs_AC ✓1ms3668kbC++142.1kb2024-10-18 19:35:312024-10-18 19:35:33

Judging History

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

  • [2024-10-18 19:35:33]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3668kb
  • [2024-10-18 19:35:31]
  • 提交

answer

#include <bits/stdc++.h>
// #pragma GCC optimize(2)
#define int long long
#define pii pair<int, int>
#define tpi tuple<int, int, int, int>
#define il inline
#define p_q priority_queue
#define u_m unordered_map
#define bt bitset
#define rg register

using namespace std;

const int N1 = 300005;
const int N2 = 1000006;
const int mod = 998244353;

using i64 = long long;

void chmin(int& x, int c) {
	x = min(x, c);
}
void chmax(int& x, int c) {
	x = max(x, c);
}

#define debug 1
#define multi_test_ 1
#define endl '\n'

int _test_ = 1;

namespace zqh {
	int a, b, c;
	char ch[300][300];

	void init() {
		cin >> a >> b >> c;
		for (int i = 1; i <= 299; i++) {
			for (int j = 1; j <= 299; j++) {
				ch[i][j] = '.';
			}
		}
	}

	void solve() {
		for (int i = 1; i <= 2 * c + 1; i++) {
			for (int j = 1; j <= 2 * a + 1; j++) {
				ch[i + 2 * b][j] = (i & 1) ? ((j & 1) ? '+' : '-') : ((j & 1) ? '|' : '.');
			}
		}
		for (int i = 1; i <= 2 * b + 1; i++) {
			for (int j = 2 * b + 2 - i, k = 1; k <= 2 * a + 1; j++, k++) {
				if (i & 1) {
					if (k & 1) {
						ch[i][j] = '+';
					} else {
						ch[i][j] = '-';
					}
				} else {
					if (k & 1) {
						ch[i][j] = '/';
					} else {
						ch[i][j] = '.';
					}
				}
			}
		}
		for (int i = 1; i <= 2 * b + 1; i++) {
			int j = 2 * (a + b) + 1 - (2 * b + 1 - i);
			for (int k = 0; k < 2 * c + 1; k++) {
				int ti = 2 * b + 2 - i + k;
				if (i & 1) {
					if (k & 1) {
						ch[ti][j] = '|';
					} else {
						ch[ti][j] = '+';
					}
				} else {
					if (k & 1) {
						ch[ti][j] = '.';
					} else {
						ch[ti][j] = '/';
					}
				}
			}
		}
		for (int i = 1; i <= 2 * (c + b) + 1; i++) {
			for (int j = 1; j <= 2 * (a + b) + 1; j++) {
				cout << ch[i][j];
			}
			cout << endl;
		}
	}

	void main() {
		init();
		solve();
	}
}  // namespace zqh

signed main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
#ifdef debug
#endif
#ifdef multi_test_
	cin >> _test_;
#endif
	while (_test_--) {
		zqh::main();
	}
	return 0;
}
/*

*/

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3544kb

input:

2
1 1 1
6 2 4

output:

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

result:

ok 18 lines

Test #2:

score: 0
Accepted
time: 1ms
memory: 3668kb

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